import { Controller, Get } from '@nestjs/common';
import { Ctx, MessagePattern, Payload, RedisContext } from '@nestjs/microservices';
import { AppService } from './app.service';

@Controller()
export class AppController {
    constructor(private readonly appService: AppService) {}

    @MessagePattern({ cmd: 'getRedisData' })
    getNotifications(@Payload() data: number[], @Ctx() context: RedisContext) {
        console.log(data, 'redis_host', process.env.REDIS_HOST);
        return data;
    }
}
